package org.ourgrid.broker.status;

import java.io.Serializable;

import org.ourgrid.common.spec.peer.PeerSpec;

public class PeerStatusInfo implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String state;
	private PeerSpec peerSpec;
	
	public PeerStatusInfo() {}
	
	public PeerStatusInfo(String state, PeerSpec spec) {
		this.state = state;
		this.peerSpec = spec;
	}

	public PeerSpec getPeerSpec() {
		return peerSpec;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public boolean isDown() {
		return this.state.equals("DOWN"); 
	}
	
	public boolean isUp() {
		return this.state.equals("UP"); 
	}
	
	public boolean isLogged() {
		return this.state.equals("LOGGED"); 
	}

	public void setPeerSpec(PeerSpec peerSpec) {
		this.peerSpec = peerSpec;
	}

}
